/*
 * @Author: Dufen~123 dufen.0
 * @Date: 2024-12-25 16:14:41
 * @LastEditors: Dufen~123 dufen.0
 * @LastEditTime: 2024-12-25 16:15:15
 * @FilePath: \my-app\src\pages\ParentComponent4\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React, { useState } from 'react';
import ChildComponent from './components/ChildComponent4';

const ParentComponent = () => {
  const [isTrue, setIsTrue] = useState(false);

  const handleUpdate = () => {
    setIsTrue(true);
  };

  return (
    <div>
      <h1>父组件</h1>
      <p>子组件传递的参数: {isTrue ? 'true' : 'false'}</p>
      <ChildComponent onUpdate={handleUpdate} />
    </div>
  );
};

export default ParentComponent;
